/*
 * Peer.cpp
 *
 *  Created on: 05/09/2011
 *      Author: george
 */

#include "peer.h"

Peer::~Peer(){
	delete this->session;
}

Peer::Peer(){
	this->session = 0;
}

Peer::Peer(in_addr addr) : Host (addr) {
	this->session = new Session();
}

Peer::Peer(in_addr addr, Session *session) : Host (addr){
	this->session  = session;
}


bool Peer::operator>(const Peer &rhs) const{
	return this->ip > rhs.ip;
}

bool Peer::operator<(const Peer &rhs) const{
	return this->ip < rhs.ip;
}

bool Peer::operator==(const Peer &rhs) const{
	return this->ip == rhs.ip;
}

bool Peer::operator!=(const Peer &rhs) const{
	return this->ip != rhs.ip;
}
